package com.tledu.springboot04.controller;

import com.tledu.springboot04.service.IResourceService;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

@Controller
@AllArgsConstructor
public class IndexController {

    private final IResourceService resourceService;

    @GetMapping(value = {"/", "/index"})
    public String index(Model model) {
        model.addAttribute("menu", resourceService.treeList());
        return "index";
    }
}
